<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('签到列表')" />
	<th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							

							<li style="display: none">
								用户id：<input type="text" name="uid" th:value=${userId} />
							</li>

							
							
							<li class="select-selectpicker">
								<label>签到奖励： </label><select name="signJinb" class="selectpicker" data-none-selected-text="请选择">
								<option></option>
									<option value="8001">金币</option>
									<option value="8002">代金券</option>
									<option value="8003">心愿单（小）</option>
									<option value="8004">心愿单（大）</option>									
								</select>
							</li>

							

							
							<li class="select-selectpicker">
								<label>签到形式： </label><select name="flag" class="selectpicker" data-none-selected-text="请选择">
								<option></option>
									<option value=0>正常签到</option>
									<option value=1>补签</option>
																	
								</select>
							</li>
							
							<li class="select-time">								
								<label>签到时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
				
				<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="Sign:sign:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('Sign:sign:edit')}]];
        var removeFlag = [[${@permission.hasPermi('Sign:sign:remove')}]];
        var prefix = ctx + "Sign/sign";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "签到",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '',
					visible: false
				},
				
				{
					field : 'uid', 
					title : '用户id',
					sortable: true
				},
				
				{
					title: '签到奖励',
				    formatter: function(value, row, index) {
				    	if(row.signJinb==8001){
				    		return "金币";
				    	} else if(row.signJinb==8002) {
				    		return "代金券";
				    	} else if(row.signJinb==8003) {
				    		return "心愿单（小）";
				    	} else if(row.signJinb==8004) {
				    		return "心愿单（大）";
				        } else {
				        	return "无";
				        }
				        }
					},
				{
					field : 'signTs', 
					title : '连续签到天数',
					sortable: true
				},
				
			
				
				
				{
					title: '签到形式',
				    formatter: function(value, row, index) {
				    	if(row.flag==0){
				    		return "正常签到";
				    	} else if(row.flag==1){
				    		return "补签";
				    	} 
				    }
					},
				{
					field : 'signDate', 
					title : '签到时间',
					sortable: true
				}]
            };
            $.table.init(options);
        });
        
        function userPacketsUpdate(id) {       	
        	var options = {
   				title: "用户签名详情",
   				width: 900,
   				height: 600,
   				url: prefix + "/edit/" + id,
   				skin: 'layui-layer-gray', 
   				btn: ['关闭'],
   				yes: function (index, layero) {
   	                layer.close(index);
                }
   			};
        	$.modal.openOptions(options);
        }
    </script>
</body>
</html>